$(function(){
	var popBox = document.getElementsByClassName('popBox');
	var canva  = document.getElementsByClassName('canva');
	$('.sixinBtn').click(function(){
		popBox[0].style.display = "block";
		canva[0].style.display = "block";
		$('#sixin').focus();


		$(".submitBtn").click(function(){
			var sixin = $('#sixin').val();
			var to = $('.sixinBtn').attr('name');
			var from = $('#from').val();

			//alert(to);alert(from);alert(sixin);return false;
			
			if (sixin=="") {
				alert("请输入内容!");
				$('#sixin').focus();
				return false;
			};

			$.post("/admin/sixin_save.php",{from:from,to:to,sixin:sixin},function(data){
				if (data.status==true) {
					alert(data.info);
					history.go(0);
				}else{
					alert(data.info);
				}
			}, "json");		
		})
	});

});